process: add process.entrypoint - #64800
Conversation
Signed-off-by: avivkeller <me@aviv.sh>
|
Review requested:
|
|
@nodejs/process |
|
in worker threadsx this is set to the entrypoint of the worker? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64800 +/- ##
==========================================
- Coverage 90.16% 90.12% -0.05%
==========================================
Files 744 744
Lines 242518 242571 +53
Branches 45705 45695 -10
==========================================
- Hits 218670 218615 -55
- Misses 15357 15443 +86
- Partials 8491 8513 +22
🚀 New features to boost your workflow:
|
This is set to the entrypoint of the process that created the worker, not the worker itself. So if |
this is behaviorally different from the old "require.main". Can we have the same? |
|
IMO it makes more sense to show the entrypoint of the process, not the worker |
|
I'm saying this is not identical to require.main, or what import.main is defined. The issue linked refers to require.main. |
|
Okay, I've changed |
|
Opened #64903 with the thread-scoped counterpart ( |
Ref: #51840
Adds a
process.entrypointnon-configurable property to theprocessobject during bootstrap. This property reflects the executable's main entrypoint (i.e. not--requireor--import-ed files, the main file).Additionally, this entrypoint is passed to workers, so it reflects the entrypoint of the process that created the worker, not the entrypoint of the worker itself.